<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登录</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<link rel="icon" href="static/easyui/themes/icons/tx.jpg" type="image/x-icon">
<style type="text/css">
.admin_login{
	width: 300px;
    height: auto;
    overflow: hidden;
    margin: 10% auto 0 auto;
    padding: 40px;
    box-shadow: 0 -15px 30px lightslategrey;
    border-radius: 5px;
    margin: 10% 0 0 25%
}
.admin_login dd {
    margin: 5px 0;
    height: 42px;
    overflow: hidden;
    position: relative;
}
.admin_login dt {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 0 1px #0e947a;
    margin-bottom: 15px;
    letter-spacing: 2px;
}
.admin_login dd .login_txtbx {
    font-size: 14px;
    height: 26px;
    line-height: 26px;
    padding: 8px 5%;
    width: 90%;
    text-indent: 2em;
    border: none;
    background: #F2F2F2;
    color: black;
}
.admin_login dd .submit_btn {
    width: 100%;
    height: 42px;
    border: none;
    font-size: 16px;
    background: beige;
    color: #91908e;
    cursor: pointer;
    border-radius:3px;
}
body{
	background:url(static/easyui/themes/icons/login.jpg) no-repeat;
	background-size:cover;
}
</style>
</head>
<body>

<!-- <div style="width:350px;height:400px;position:absolute;border:solid 1px red;right:60px;top:100px;"> -->
	<dl class="admin_login">
     <dt>
      <strong>Decade公司在线工作平台(OA)</strong>
      <em>Decade 欢迎登陆</em>
    </dt>
    <dd class="user_icon">
     
    <input name="staff_name" type="text" placeholder="账号" class="login_txtbx user" required="required">
    </dd>
    <dd class="pwd_icon">
      <input name="staff_pwd" type="password" placeholder="密码" class="login_txtbx pwd" required="required">
    </dd>
    
    <dd>
      <input type="submit" value="立即登陆" class="submit_btn">
    </dd>
  </dl>
<!-- </div> -->


<script type="text/javascript">

	$(function(){
		$(".submit_btn").click(function(){
			
			var user=$(".user").val().trim();
			var pwd=$(".pwd").val().trim();
			
			if(user!=""&&pwd!=""){
				$.ajax({
					url:"loginok",
					type:"post",
					data:{"staff_name":user,"staff_pwd":pwd}, 
					async:false,//同步，默认true既异步访问 
					success:function(data){
						if(data==1){
							alert("ok");
							location.href="tomainhome";
						}else{
							alert("账号或密码错误/权限不够");
						} 
					}
				})
				
			}else{
				alert("账号或密码为空");
			}
		});
	});
</script>
</body>
</html>